import Router from 'koa-router';
import statisticsController from '../controllers/statistics.controller';
import { authMiddleware } from '../middlewares/auth.middleware';

const router = new Router({
  prefix: '/api/statistics',
});

// 获取系统概况统计
router.get(
  '/dashboard',
  authMiddleware,
  statisticsController.getDashboardOverview
);

// 获取文章统计数据
router.get(
  '/articles',
  authMiddleware,
  statisticsController.getArticleStats
);

// 获取用户统计数据
router.get(
  '/users',
  authMiddleware,
  statisticsController.getUserStats
);

// 获取评论统计数据
router.get(
  '/comments',
  authMiddleware,
  statisticsController.getCommentStats
);

// 获取分类统计数据
router.get(
  '/categories',
  authMiddleware,
  statisticsController.getCategoryStats
);

// 获取标签统计数据
router.get(
  '/tags',
  authMiddleware,
  statisticsController.getTagStats
);

// 获取热门文章
router.get(
  '/popular-articles',
  authMiddleware,
  statisticsController.getPopularArticles
);

// 获取文章趋势数据
router.get(
  '/article-trend',
  authMiddleware,
  statisticsController.getArticleTrend
);

// 获取用户增长趋势数据
router.get(
  '/user-growth-trend',
  authMiddleware,
  statisticsController.getUserGrowthTrend
);

export default router;
